package com.vanysoft.business.data.service.impl;

import com.baomidou.mybatisplus.plugins.Page;
import com.baomidou.mybatisplus.service.impl.ServiceImpl;
import com.vanysoft.business.data.dao.DunsLinkMapper;
import com.vanysoft.business.data.entity.DunsLink;
import com.vanysoft.business.data.service.DunsLinkService;
import org.springframework.stereotype.Service;

import java.util.HashMap;
import java.util.List;
import java.util.Map;

/**
 * <p>
 * 供应商集团邓白氏编码关联 服务实现类
 * </p>
 *
 * @author YangLei
 * @since 2018-07-16
 */
@Service
public class DunsLinkServiceImpl extends ServiceImpl<DunsLinkMapper, DunsLink> implements DunsLinkService {

    @Override
    public Page<DunsLink> selectPage(Page<DunsLink> page, String ultimate, String elementary, String[] categories) {
        Map<String, Object> map = new HashMap<>();
        map.put("ultimate", ultimate);
        map.put("elementary", elementary);
        map.put("categories", categories);
        List<DunsLink> list = baseMapper.selectPage(page, map);
        page.setRecords(list);
        return page;
    }

    @Override
    public List<String> selectAllLinkCategory() {
        return baseMapper.selectAllLinkCategory();
    }
}
